#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright [Gtlions Lai].
# Create Date:
# Update Date:
"""summarization ahout this script.

detail ahout this script

   Class(): summarization about Class
   ...
   function(): summarization about function
   ...
"""
__authors__ = '"Gtlions Lai" <gtlions.l@qq.com>'

import sys
from PyQt4 import QtGui, QtCore


class Main(QtGui.QMainWindow):
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self)
        self.setWindowTitle('QMainWindow')
        self.setGeometry(300, 300, 300, 300)
        grid = QtGui.QGridLayout()
        #self.setLayout(grid)

        # 菜单栏
        menubar = QtGui.QMenuBar(self)

        # 菜单夹 file
        menu_file = QtGui.QMenu(self)
        menu_file.setTitle(u'文件')
        # 菜单项 open
        menu_file_open = QtGui.QAction(self)
        menu_file_open.setText(u'打开')
        # 菜单项 关闭
        menu_file_close = QtGui.QAction(self)
        menu_file_close.setText(u'关闭')

        # 菜单夹 关于
        menu_about = QtGui.QMenu(self)
        menu_about.setTitle(u'关于')
        # 菜单项 关于我
        menu_about_me = QtGui.QAction(self)
        menu_about_me.setText(u'关于我')

        # 组装菜单夹
        menu_file.addAction(menu_file_open)
        menu_file.addAction(menu_file_close)
        menu_about.addAction(menu_about_me)

        # 组装菜单栏
        menubar.addMenu(menu_file)
        menubar.addMenu(menu_about)
        self.setMenuBar(menubar)

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    main = Main()
    main.show()
    sys.exit(app.exec_())